#include "hellowinproc.h"

LRESULT HelloWinProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lparam)
{
    HDC hdc;
    switch(message){
        case MSG_PAINT:                             /* 屏幕输出 */
            hdc = BeginPaint(hWnd);                 /* 获取设备上下文句柄 */
            TextOut(hdc, 100, 60, "Hello, World!");  /* 显示“Hello， World” */
            EndPaint(hWnd, hdc);                    /* 释放设备上下文句柄 */
            return 0;

        case MSG_CLOSE:
            DestroyMainWindow(hWnd);                /* 破坏主窗口、不会释放资源 */
            PostQuitMessage(hWnd);                  /* 抛出MSG_QUIT消息 */
            return 0;
    }
    return DefaultMainWinProc(hWnd, message, wParam, lparam);
}
